﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ZhimeiSoft.CharmManager.DOL
{
    /// <summary>
    /// 员工信息表
    /// </summary>
    [Serializable()]
    public class DBEntityEmployee : DBEntityBase
    {
        /// <summary>
        /// 表名称
        /// </summary>
        /// <returns>返回表名称</returns>
        public override string GetTableName()
        {
            return "EMPLOYEEINFO";
        }

        public DBEntityEmployee()
            : base()
        {
        }

        public DBEntityEmployee(DataRow drRow)
        {
            this.EMPLOYEEID = Convert.ToInt32(drRow[DBEntityEmployee.FieldName.EMPLOYEEID]);
            this.EMPLOYEENAME = drRow[DBEntityEmployee.FieldName.EMPLOYEENAME].ToString();
            this.ENAME = drRow[DBEntityEmployee.FieldName.ENAME].ToString();
            this.ECODE = drRow[DBEntityEmployee.FieldName.ECODE].ToString();
            this.ECARD = drRow[DBEntityEmployee.FieldName.ECARD].ToString();
            this.EBIRTHDAY = Convert.ToDateTime(drRow[DBEntityEmployee.FieldName.EBIRTHDAY]);
            this.EADDRESS = drRow[DBEntityEmployee.FieldName.EADDRESS].ToString();
            this.EMOBILEPHONE = drRow[DBEntityEmployee.FieldName.EMOBILEPHONE].ToString();
            this.EFAMLIYPHONE = drRow[DBEntityEmployee.FieldName.EFAMLIYPHONE].ToString();
            this.EDUCATION = drRow[DBEntityEmployee.FieldName.EDUCATION].ToString();
            this.ENTRYDAY = Convert.ToDateTime(drRow[DBEntityEmployee.FieldName.ENTRYDAY]);
            this.EQUITDAY = Convert.ToDateTime(drRow[DBEntityEmployee.FieldName.EQUITDAY]);
            this.ESTATE = drRow[DBEntityEmployee.FieldName.ESTATE].ToString();
            this.EINDEXCODE = drRow[DBEntityEmployee.FieldName.EINDEXCODE].ToString();
            this.SALONID = Convert.ToInt32(drRow[DBEntityEmployee.FieldName.SALONID]);
            this.EPASSWORD = drRow[DBEntityEmployee.FieldName.EPASSWORD].ToString();
            this.ISRESERVERATION = Convert.ToInt16(drRow[DBEntityEmployee.FieldName.ISRESERVERATION]);

        }
        /// <summary>
        /// 主记录
        /// </summary>
        public int EMPLOYEEID { get; set; }
        /// <summary>
        /// 员工姓名
        /// </summary>
        public string EMPLOYEENAME { get; set; }
        /// <summary>
        /// 昵称
        /// </summary>
        public string ENAME { get; set; }
        /// <summary>
        /// 代码
        /// </summary>
        public string ECODE { get; set; }
        /// <summary>
        /// 身份证号码
        /// </summary>
        public string ECARD { get; set; }
        /// <summary>
        /// 生日
        /// </summary>
        public DateTime EBIRTHDAY { get; set; }
        /// <summary>
        /// 住址
        /// </summary>
        public string EADDRESS { get; set; }
        /// <summary>
        /// 移动电话
        /// </summary>
        public string EMOBILEPHONE { get; set; }
        /// <summary>
        /// 家庭电话
        /// </summary>
        public string EFAMLIYPHONE { get; set; }
        /// <summary>
        /// 学历
        /// </summary>
        public string EDUCATION { get; set; }
        /// <summary>
        /// 入职日期
        /// </summary>
        public DateTime ENTRYDAY { get; set; }
        /// <summary>
        /// 离职日期
        /// </summary>
        public DateTime EQUITDAY { get; set; }
        /// <summary>
        /// F0E 在职、 F0Q 离职、 F0S停岗
        /// </summary>
        public string ESTATE { get; set; }
        /// <summary>
        /// 快速定位码
        /// </summary>
        public string EINDEXCODE { get; set; }
        /// <summary>
        /// 属于哪个店
        /// </summary>
        public int SALONID { get; set; }
        /// <summary>
        /// 员工密码
        /// </summary>
        public string EPASSWORD { get; set; }
        /// <summary>
        /// 是否可以进行预约
        /// </summary>
        public int ISRESERVERATION { get; set; }

        /// <summary>
        ///F0E 在职  F0Q 离职  F0S停岗
        /// </summary>
        public static class ENUM_ESTATE
        {
            /// <summary>
            ///  F0E 在职
            /// </summary>
            public const string F0E = "F0E";
            /// <summary>
            ///   F0Q 离职
            /// </summary>
            public const string F0Q = "F0Q";
            /// <summary>
            ///  F0S停岗
            /// </summary>
            public const string F0S = "F0S";
            /// <summary>
            ///  F0E 在职
            /// </summary>
            public const string F0E_CHINESE = "在职";
            /// <summary>
            ///   F0Q 离职
            /// </summary>
            public const string F0Q_CHINESE = "离职";
            /// <summary>
            ///  F0S停岗
            /// </summary>
            public const string F0S_CHINESE = "停岗";
            /// <summary>
            /// 根据枚举值返回中文
            /// </summary>
            /// <param name="cState">枚举值</param>
            /// <returns>返回中文</returns>
            public static string EnumStrToChineseStr(string cState)
            {
                string[] serchStr = new string[] { F0E, F0Q, F0S };
                string[] sReturnStr = new string[] { F0E_CHINESE, F0Q_CHINESE, F0S_CHINESE };
                return DBEntityBase.GetStrReturnStr(cState, serchStr, sReturnStr);
            }
            /// <summary>
            /// 根据中文返回枚举值
            /// </summary>
            /// <param name="chineseStr">中文</param>
            /// <returns>返回枚举字符串</returns>
            public static string ChineseStrToEnumStr(string chineseStr)
            {
                string[] serchStr = new string[] { F0E_CHINESE, F0Q_CHINESE, F0S_CHINESE };
                string[] sReturnStr = new string[] { F0E, F0Q, F0S };
                return DBEntityBase.GetStrReturnStr(chineseStr, serchStr, sReturnStr);
            }

        }
        /// <summary>
        /// 字段名
        /// </summary>
        public static class FieldName
        {
            /// <summary>
            /// 主记录
            /// </summary>
            public const string EMPLOYEEID = "EMPLOYEEID";
            /// <summary>
            /// 员工姓名
            /// </summary>
            public const string EMPLOYEENAME = "EMPLOYEENAME";
            /// <summary>
            /// 昵称
            /// </summary>
            public const string ENAME = "ENAME";
            /// <summary>
            /// 代码
            /// </summary>
            public const string ECODE = "ECODE";

            /// <summary>
            /// '代码 姓名'的组合 
            /// </summary>
            public const string EFULLNAME = "EFULLNAME";

            /// <summary>
            /// 身份证号码
            /// </summary>
            public const string ECARD = "ECARD";
            /// <summary>
            /// 生日
            /// </summary>
            public const string EBIRTHDAY = "EBIRTHDAY";
            /// <summary>
            /// 住址
            /// </summary>
            public const string EADDRESS = "EADDRESS";
            /// <summary>
            /// 移动电话
            /// </summary>
            public const string EMOBILEPHONE = "EMOBILEPHONE";
            /// <summary>
            /// 家庭电话
            /// </summary>
            public const string EFAMLIYPHONE = "EFAMLIYPHONE";
            /// <summary>
            /// 学历
            /// </summary>
            public const string EDUCATION = "EDUCATION";
            /// <summary>
            /// 入职日期
            /// </summary>
            public const string ENTRYDAY = "ENTRYDAY";
            /// <summary>
            /// 离职日期
            /// </summary>
            public const string EQUITDAY = "EQUITDAY";
            /// <summary>
            /// F0E 在职、 F0Q 离职、 F0S停岗
            /// </summary>
            public const string ESTATE = "ESTATE";
            /// <summary>
            /// 快速定位码
            /// </summary>
            public const string EINDEXCODE = "EINDEXCODE";
            /// <summary>
            /// 属于哪个店
            /// </summary>
            public const string SALONID = "SALONID";
            /// <summary>
            /// EMAIL
            /// </summary>
            public const string EMIAL = "EMIAL";
            /// <summary>
            /// QQ号码
            /// </summary>
            public const string EQQ = "QQNBR";
            /// <summary>
            /// 密码
            /// </summary>
            public const string EPASSWORD = "EPASSWORD";
            /// <summary>
            /// 是否可以预约的员工
            /// </summary>
            public const string ISRESERVERATION = "ISRESERVERATION";
        }
    }
}
